import request from '@/utils/request'

// 购物车添加商品
export const addGoodsToCartService = (goodsId, goodsNum, userId) => {
    return request.post('/cart/add', {
        goodsId,
        goodsNum,
        userId
    }, {
        headers: {
            'Content-Type': 'application/json'
        }
    });
};

//获取购物车列表
export const getCartlist = (id) =>{
    return request.get('/cart/list',{params: { id: id}})
}

//删除购物车数据
export const clearCart = (id) =>{
    return request.get('/cart/clear',{params: {id: id}})
}
